home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Ss-Sz / StkAnalyz.cpt / Stack Analyzer / card_2992.txt < prev    next >
Encoding:
Text File  |  1988-04-18  |  6.3 KB  |  224 lines

  1. -- card: 2992 from stack: in
  2. -- bmap block id: 2326
  3. -- flags: 0000
  4. -- background id: 2763
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0003
  11. -- rect: left=222 top=25 right=76 bottom=285
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 27056 / 27056
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Analysis
  20. ----- HyperTalk script -----
  21. on mouseup
  22.   global userName,showScripts,showEvents,analysis,theScripts
  23.   put empty into background field 1
  24.   put empty into user
  25.   if userName is not empty then put ", " &word 1 of userName into user
  26.   ask "Analyze what stack" &user &"?" with the short name of this stack
  27.   if it is not empty then
  28.     put it into theStack
  29.     answer "Do message tracking?" with "Yes" or "No"
  30.     put (it="Yes") into showEvents
  31.     answer "Do script extraction?" with "Yes" or "No"
  32.     put (it="Yes") into showScripts
  33.     if user is not empty then put " for " &userName into user
  34.     put "Analysis of " &theStack &" stack" &user into analysis
  35.     if showEvents or showScripts then put " with" after analysis
  36.     if showEvents then put " message tracking" after analysis
  37.     if showEvents and showScripts then put " and" after analysis
  38.     if showScripts then put " script extraction" after analysis
  39.     put return &return after analysis
  40.     setLocks true
  41.     analyze theStack,0
  42.     setLocks false
  43.     put analysis &theScripts &return &"End of analysis" into background field 1
  44.     put empty into analysis
  45.     put empty into theScripts
  46.     hide message box
  47.   end if
  48. end mouseup
  49.  
  50. on setLocks flag
  51.   if flag then set cursor to 4 else pop card
  52.   if flag then set lockScreen to true else set lockScreen to false
  53.   if flag then set lockMessages to true else set lockMessages to false
  54.   if flag then set lockRecent to true else set lockRecent to false
  55.   if flag then push this card else set cursor to 1
  56. end setLocks
  57.  
  58. on analyze thing,lev
  59.   global analysis, showScripts, showEvents, theScripts
  60.   put the name of thing into itsName
  61.   put "Now examining " &itsName
  62.   put indent(lev) &itsName &return after analysis
  63.   if lev<2 then go to thing
  64.   put word 1 of itsName into object
  65.   if object="stack" then put "bkgnd,card" into sub
  66.   if object="bkgnd" or object="card" then put object &" field," &object &" button" into sub
  67.   if object="card" and lev=1 then
  68.     put indent(lev) &" of" after analysis
  69.     put the name of this bkgnd &return after analysis
  70.   end if
  71.  
  72.   if showScripts then
  73.     put the script of thing into itsScript
  74.     if itsScript is not empty then
  75.       put return &"Script of " &itsName &return after theScripts
  76.       put itsScript &return after theScripts
  77.     end if
  78.   end if
  79.  
  80.   if showEvents then
  81.     put the script of thing into itsScript
  82.     put the number of lines of itsScript into nlines
  83.     if nlines>2 then
  84.       put "Now examining the script of " &itsName
  85.       put indent(lev) &"- handles these message(s):" &return after analysis
  86.       repeat with i=1 to nlines
  87.         put line i of itsScript into linei
  88.         put word 1 of linei into word1
  89.         if (word1="on") then put indent(lev) &" " &(word 2 of linei) &return after analysis
  90.         if(word1="pass") then put indent(lev) &" (which it passes)" &return after analysis
  91.         if(word1="send") then put indent(lev) &"(It sends message " &(word 2 of linei) &" to " &(word 4 of linei) &")" &return after analysis
  92.       end repeat
  93.     end if
  94.   end if
  95.  
  96.   if lev<2 then
  97.     do "put the number of " &(item 1 of sub) &"s into n1"
  98.     do "put the number of " &(item 2 of sub) &"s into n2"
  99.     if n1<>1 then put "s" into s1 else put "" into s1
  100.     if n2<>1 then put "s" into s2 else put "" into s2
  101.     if n1+n2>0 then
  102.       put indent(lev) &" contains " &n1 &" " &(item 1 of sub) after analysis
  103.       put s1 &" and " &n2 &" " &(item 2 of sub) &s2 &return after analysis
  104.       repeat with i=1 to 2
  105.         do "put the number of " &(item i of sub) &"s into n"
  106.         repeat with j=1 to n
  107.           put (item i of sub) &" "&j into m
  108.           analyze m,lev+1
  109.         end repeat
  110.       end repeat
  111.     end if
  112.   end if
  113. end analyze
  114.  
  115. function indent level
  116. repeat with i=1 to level+1
  117.   put "  " after s
  118. end repeat
  119. return(s)
  120. end indent
  121.  
  122.  
  123. -- part 3 (button)
  124. -- low flags: 00
  125. -- high flags: 0003
  126. -- rect: left=442 top=25 right=78 bottom=504
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 20098 / 20098
  129. -- text alignment: 1
  130. -- font id: 0
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: New Button
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   go home
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 4 (button)
  143. -- low flags: 00
  144. -- high flags: 0003
  145. -- rect: left=369 top=25 right=77 bottom=434
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 1007 / 1007
  148. -- text alignment: 1
  149. -- font id: 0
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: New Button
  154. ----- HyperTalk script -----
  155. on mouseUp
  156.   domenu "Print Report..."
  157. end mouseUp
  158.  
  159.  
  160.  
  161. -- part 5 (button)
  162. -- low flags: 00
  163. -- high flags: 0003
  164. -- rect: left=295 top=25 right=76 bottom=361
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 110 / 110
  167. -- text alignment: 1
  168. -- font id: 0
  169. -- text size: 12
  170. -- style flags: 0
  171. -- line height: 16
  172. -- part name: New Button
  173. ----- HyperTalk script -----
  174. on mouseUp
  175.   put the short name of this stack &".txt" into fileName
  176.   ask "Export text to what file?" with fileName
  177.   if it is empty then exit mouseup
  178.   put it into fileName
  179.   open file fileName
  180.   go to first card
  181.   write background field "Display" to file filename
  182.   close file fileName
  183. end mouseUp
  184.  
  185.  
  186.  
  187. -- part 6 (button)
  188. -- low flags: 00
  189. -- high flags: 0003
  190. -- rect: left=456 top=287 right=340 bottom=504
  191. -- title width / last selected line: 0
  192. -- icon id / first selected line: 2 / 2
  193. -- text alignment: 1
  194. -- font id: 0
  195. -- text size: 12
  196. -- style flags: 0
  197. -- line height: 16
  198. -- part name: New Button
  199. ----- HyperTalk script -----
  200. on mouseUp
  201.   answer "YES erases the current analysis:" with "YES" or "Not now"
  202.   if it is "YES" then put empty into background field "Display"
  203. end mouseUp
  204.  
  205.  
  206.  
  207. -- part 7 (button)
  208. -- low flags: 00
  209. -- high flags: 0000
  210. -- rect: left=148 top=51 right=83 bottom=194
  211. -- title width / last selected line: 0
  212. -- icon id / first selected line: 2478 / 2478
  213. -- text alignment: 1
  214. -- font id: 0
  215. -- text size: 12
  216. -- style flags: 0
  217. -- line height: 16
  218. -- part name: New Button
  219. ----- HyperTalk script -----
  220. on mouseUp
  221.   go next card
  222. end mouseUp
  223.  
  224.